<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="|#{customer.systemTitle}-图灵谷-全局配置-全局配置|">图灵谷</title>
<div th:replace="fragments/head_admin">head</div>
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div th:replace="fragments/nav_admin">导航栏</div>
		<div th:replace="fragments/menu_admin::menu(parent=material,child=image)">菜单栏</div>
		<div class="layui-body">
			<div class="layui-main">
				<!--/***** 面包屑 *****/-->
				<div class="layui-elem-quote" style="margin-top: 10px;">
					<span class="layui-breadcrumb"> <a><cite>素材管理</cite></a> <a href="#">图片管理</a> <a><cite>列表</cite></a>
					</span>
				</div>
				<blockquote class="layui-elem-quote layui-quote-nm">
					<div class="layui-inline">
						<div class="layui-input-inline">
							<a th:href="@{/admin/m/base/image/imageUpload.gsp}" class="layui-btn"><i class="layui-icon">&#xe608;</i> 新增</a>
						</div>
					</div>
				</blockquote>
				<div>
					<table cellspacing="0" width="100%" class="layui-table" lay-even="" lay-skin="row">
						<thead>
							<tr>
								<th width="40" class="text-center">#</th>
								<th class="text-center">图片名称</th>
								<th class="text-center">图片路径</th>
								<th class="text-center">图片大小</th>
								<th width="90" class="text-center">操作</th>
							</tr>
						</thead>
						<tbody>
							<tr th:if="${imgList.records == null or imgList.records.size() == 0}">
								<td colspan="5" style="text-align: center;">暂时没有数据</td>
							</tr>
							<tr th:each="item,itemStat:${imgList.records}">
								<td th:text="${imgList.pageSize*(imgList.page-1)+itemStat.index+1}" style="text-align: center;"></td>
								<td th:text="${item.imgName}"></td>
								<td th:text="${item.imgPath}"></td>
								<td th:text="${item.imgLength}"></td>
								<td><a th:href="|@{/admin/m/base/image/show_}${item.id}.gsp|" class="layui-btn layui-btn-primary layui-btn-small"><i class="layui-icon">&#xe615;</i></a> <a th:onclick="|del('${item.id}')|" class="layui-btn layui-btn-normal layui-btn-small"> <i class="layui-icon"></i></a></td>
							</tr>
						</tbody>
					</table>
					<div id="pageDiv" style="float: center;"></div>
				</div>
			</div>
		</div>
		<div th:replace="fragments/footer_admin">底部</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
<script th:inline="javascript">
    /*<![CDATA[*/
    var result = /*[[${imgList}]]*/;
    $(function(){
        var option = {
            listUrl : /*[[@{/admin/m/base/image/list.gsp?}]]*/,
            totalPages : result.totalPages,
            page : result.page,
            param : {
            }
        };
        tg_basePage(option);
    })
    var deleteUrl = /*[[@{/admin/m/base/image/delete_{id}.gsp}]]*/;
    function del(id){
        tg_deleteItem(deleteUrl.replace('{id}',id), function(){
            location.reload();
        });       
    }
    /*]]>*/
</script>
</html>